package com.baba.vote.common;

import lombok.Getter;

/**
 * @author moxinHuoHuo
 * @createDate 2019/10/17 17:46
 */
@Getter
public class VoteException extends RuntimeException {

    private VoteErrorCode errorCode;

    private String errorMessage;

    public VoteException(VoteErrorCode errorCode) {
        super(errorCode.getValueCn());
        this.errorCode = errorCode;
        this.errorMessage = "";
    }

    public VoteException(VoteErrorCode errorCode, String msg) {
        super(msg);
        this.errorCode = errorCode;
        this.errorMessage = msg;
    }

    public VoteException(String errorMessage) {
        super(errorMessage);
        this.errorCode = VoteErrorCode.SYS_ERR;
        this.errorMessage = errorMessage;
    }


}
